home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: uu4news.netcom.com!zodiac!szh
- From: szh@zcon.com (Syed Zaeem Hosain)
- Subject: Re: Checking For Keyboard Input
- Message-ID: <1996Feb28.182012.28428@zcon.com>
- Sender: szh@zcon.com (Syed Zaeem Hosain)
- Nntp-Posting-Host: zodiac
- Reply-To: szh@zcon.com
- Organization: Z Consulting Group
- References: <1176@altheim.win-uk.net>
- Date: Wed, 28 Feb 1996 18:20:12 GMT
-
- In article <1176@altheim.win-uk.net>, broldham@altheim.win-uk.net (Brian R. Oldham) writes:
- >
- >In article <4gqm3pINNkbu@keats.ugrad.cs.ubc.ca>, Kazimir Kylheku (c2a192@ugrad.cs.ubc.ca) writes:
- >>In article <cerebus.34.000DD98A@voicenet.com>,
- >>aLEX <cerebus@voicenet.com> wrote:
- >>>Hello fellow C programmers,
- >>
- >>That's a little presumptious, don't you think?
- >>
- >
- >Also of you to say so, Kazi.
- >
- >>> Is there anyway to check if keyboard input has been entered without
- >>>actually stalling the excution of the code until the user presses a key. I
- >>>would really like to do this but I can't seem to find any way. If you know of
- >>>a way PLEASE email me or post it. Thank you in advance.
- >>
- >>This question comes up not fewer than 10 times a week in this newsgroup, yet it
- >>has nothing to do with the C language. It is more than adequatly covered in the
- >>FAQ, as you would know if you had read it.
- >>--
- >
- >If you had not been so preoccupied with your annoyance at aLEX's
- >greeting you might have answered his query - or ignored it. A simple
- >brief mention of kbhit() or equivalent, or a call to whatever interrupt
- >pauses the keyboard would have been helpful, but you may be assured,
- >none of us appreciate supercilious resposes such as this. Are you going
- ^^^^^^^^^^^^^
- >to post this crap *every* time a newbie asks a question?
- ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
- I didn't. But ... sure, why not? :-)
-
- It takes time to formulate an answer to a question that has been asked
- *many* times before, and it is a lot quicker and simpler to say:
- "Please look at question XX.XX in the FAQ." Which is what I do. The
- long and detailed answers in the FAQ would take too much time for me to
- write in here again - particularly in as good or error-free a way!
-
- Yes, I do believe that the newbie ought to be directed to read the FAQ
- before posting. If they had done so, they would have seen the following
- questions (and their answers):
-
- 19.1: How can I read a single character from the keyboard without
- waiting for the RETURN key? How can I stop characters from
- being echoed on the screen as they're typed?
-
- 19.2: How can I find out if there are characters available for reading
- (and if so, how many)? Alternatively, how can I do a read that
- will not block if there are no characters available?
-
- 19.3: How can I display a percentage-done indication that updates
- itself in place, or show one of those "twirling baton" progress
- indicators?
-
- 19.4: How can I clear the screen?
- How can I print things in inverse video?
- How can I move the cursor to a specific x, y position?
-
- 19.5: How do I read the arrow keys? What about function keys?
-
- 19.6: How do I read the mouse?
-
- among other (sometimes system-specific) questions. The answers are long
- enough to help anybody out.
-
- Z
-
-
- --
- -------------------------------------------------------------------------
- | Syed Zaeem Hosain P. O. Box 610097 (408) 441-7021 |
- | Z Consulting Group San Jose, CA 95161 szh@zcon.com |
- -------------------------------------------------------------------------
-